{% extends 'iframe/basePlus.html.twig' %}
{% block cardHeader %}发放代理{% endblock %}
{% block cardBody %}
    <form class="layui-form">
        <dry-common role="input" label="手机号" name="dry_phone" placeholder="请输入手机号"></dry-common>
        <dry-common role="input" label="优惠码" name="dry_code" placeholder="请输入优惠码"></dry-common>
        <dry-common role='select' label='主产品' name='dry_main_product' scene='none' value='' url='/Api/DataPool/getData?name=mainProduct'></dry-common>
        <dry-common role='select' label='主产品规格' name='dry_main_product_spec' scene='none' value='' url='/Api/DataPool/getData?name=mainProductSpec'></dry-common>
        <input type="hidden" name="device" id="device" value="">
        <input type="hidden" name="token" id="token" value="">
        <dry-common role="submit" submit="确定" reset="重置"></dry-common>
    </form>
    <script>
        layui.use(["dry", "jquery", "cookies"], function(dry, $, cookies){
            function getVerify()
            {
                var result = {};
                result.dry_phone = function(value){
                    if(value == ""){
                        return "请输入手机号";
                    }
                };
                result.dry_code = function(value){
                    if(value == ""){
                        return "请输入优惠码";
                    }
                };
                return result;
            }

            $("#device").val("admin");
            $("#token").val(cookies.getItem("token"));
            dry.submit(getVerify(), "", "/Api/X/sendAgent");
        });
    </script>
{% endblock %}